using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace AiPlatformAdmin.Api.DTOs;

public class UserDto
{
    public int Id { get; set; }
    public string Username { get; set; } = string.Empty;
    public string Email { get; set; } = string.Empty;
    public List<string> Roles { get; set; } = new List<string>();
    public DateTime CreatedAt { get; set; }
    public DateTime UpdatedAt { get; set; }
    public int TenantId { get; set; }
    
    public List<int> TeamIds { get; set; } = new List<int>();
}

public class CreateUserDto
{
    [Required]
    [MaxLength(100)]
    public string Username { get; set; } = string.Empty;

    [Required]
    [EmailAddress]
    [MaxLength(200)]
    public string Email { get; set; } = string.Empty;

    [Required]
    [MinLength(6)]
    public string Password { get; set; } = string.Empty;

    [Required]
    public List<string> Roles { get; set; } = new List<string>();

    public List<int>? TeamIds { get; set; }
}

public class UpdateUserDto
{
    [MaxLength(100)]
    public string? Username { get; set; }

    [EmailAddress]
    [MaxLength(200)]
    public string? Email { get; set; }

    [MinLength(6)]
    public string? Password { get; set; }

    public List<string>? Roles { get; set; }

    public List<int>? TeamIds { get; set; }
}

public class ChangePasswordDto
{
    [Required]
    public string OldPassword { get; set; } = string.Empty;

    [Required]
    [MinLength(6)]
    public string NewPassword { get; set; } = string.Empty;
}

